<template>
  <section>
    <el-table :data="data" border fit highlight-current-row  resizable style="width: 100%;" v-loading="listLoading">
      <el-table-column
        v-for="(column, index) in tableTitle"
        :key="index"
        :label="column.title"
        :width="column.width || ''"

      >
        <template slot-scope="scope">
          <my-render v-if="column.render" :row="scope.row" :render="column.render"></my-render>
          <span  v-else> {{scope.row[column.prop]}}</span>
        </template>
      </el-table-column>

    </el-table>
  </section>
</template>
<style scoped>
  .el-table tr{
    cursor: pointer;
  }
  .el-table__empty-block{
    border-bottom:1px solid #dfe6ec;
  }
</style>
<script>
  import MyRender from "./MyRender";
/**@
 * operationtype:
 * 0.没有操作
 * 1.查看详情
 * 2.报警处理
 * 3.修改
 * 4.删除
 * 5.远程断电
 * 6.解绑/绑定/换绑
 * @**/
  export default {
    data() {
      return {
        isopt:this.operationtype===1,
      }
    },
  components:{
    MyRender
  },
    props:{
      data:{
        type:Array,
          default:[]
      },
      listLoading:{
        type:Boolean,
          default:true
      },
      tableTitle:{
        type:Array,
          default:[]
      }
    }
  }
</script>
